﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TestParallel
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var presonList = new List<Person>();

            for (int i = 0; i < 100000; i++)
            {
                presonList.Add(new Person()
                {
                    Id = i,
                    Tel = 1557597 + i.ToString(),
                });
            }

            var upList = new List<Person>();

            Parallel.ForEach(presonList, (a) =>
             {
                 a.DeTel = "test233" + a.Tel;
                 upList.Add(a);
             });

            var rest = upList.Count();

            Console.WriteLine($"处理总数{rest}");
            Console.ReadLine();

            Console.WriteLine("Hello World!");
        }


        public class Person
        {
            public int Id { get; set; }

            public string Tel { get; set; }

            public string DeTel { get; set; }
        }

    }
}
